<div class="shimio"  style="overflow: auto;">
  <div class="shimname">
    <span style="float:left;"><%= link_to h(shim.name), shim %></span>
    <span style="float:right;">
	  <% if logged_in? %>
	    <% if is_admin? or shim.user_id == current_user.id %>
	      <%= link_to 'Edit', edit_shim_path(shim) %> | 
	      <%= link_to 'Delete', shim, :confirm => 
            'Are you sure you want to delete this shim?  This cannot be undone.',
             :method => :delete %>
        <% end %>
      <% end %>
    </span><br/>  
  </div>
  
  <span style="float:right; width:20%; font-size: 9px; text-align:right; ">
  	<strong>TAGS</strong><br>
	    <% tags = Annotation.with_attribute_name("tag").find(:all, 
          :conditions => {:annotatable_id => shim.id, 
              :annotatable_type => "Shim"}) %>
	  <% if tags.size > 0%>
	    <% tags.each do |x| %>
	      &nbsp;<strong><%=h " | " unless x==tags.first %></strong>&nbsp;
	      <%= link_to x.value, :controller => "shims", 
            :action => "with_annotation", :attribute_name => "tag", 
            :value => x.value %>
	    <% end %>
	  <% end %>
  </span>

  <strong>Type : </strong> <i>
	<%= link_to shim.shim_type, :controller => "shims", 
      :action => "with_type", :shim_type => shim.shim_type %></i><br />
	
  <strong>Created by : </strong><i>
  <% if shim.user %>
    <%= link_to shim.user.name, :controller => "shims", 
        :action => "belonging_to", :user_id => shim.user.id %>
	<% else %>
    User does not exist anymore.
  <% end %></i><br />
  
	<% if shim.is_service? %>
	  <strong><%= shim.shim_type =~ /wsdl/i ? "WSDL Location":"Endpoint" %> : </strong>
    <% begin %>
      <% service = Service.find(shim.service_id).endpoint_url %>
    <% rescue %>
      <% service = "ERROR PARSING ENDPOINT" %>
    <% end %>
	  <i><%= h service %></i>
  <% else %>
    <strong>Download : </strong> 
    <i><%= link_to shim.filename, :action => 'download', :id => shim.id %></i>
	<% end %>
</div>
